<template>
  <!-- 登记 -->
  <section class="reservecentre">
    <el-tabs v-model="tabsIndex" type="border-card">
      <el-tab-pane name="0" label="新增登记">
        <newRegister :qxBtns="qxBtns"></newRegister>
      </el-tab-pane>
      <el-tab-pane name="1" label="今日患者">
        <today v-if="tab1" :qxBtns="qxBtns"></today>
      </el-tab-pane>
      <el-tab-pane name="2" label="登记记录">
        <registerRecord v-if="tab2" :qxBtns="qxBtns"></registerRecord>
      </el-tab-pane>
    </el-tabs>
  </section>
</template>
<script>
export default {
  name: "register",
  components: {
    newRegister: () => import("./_com/newRegister.vue"),
    today: () => import("./_com/todayYY.vue"),
    registerRecord: () => import("./_com/registerRecord.vue")
  },
  data() {
    return {
      qxBtns: {},
      tabsIndex: "0",
      tab1: false,
      tab2: false
    };
  },
  mounted() {
    let th = this;
    th.getQX();
    const tabIndex = th.$route.query.tabIndex;
    if (tabIndex) {
      th.tabsIndex = tabIndex;
    }
    //添加缓存
    th.addPageCache("register");
  },
  watch: {
    tabsIndex(n) {
      const th = this;
      switch (n) {
        case "1":
          th.tab1 = true;
          break;
        case "2":
          th.tab2 = true;
          break;
      }
    }
  }
};
</script>
<style lang="scss" scoped>
.reservecentre {
  position: absolute;
  width: 100%;
  left: 0;
  top: 0;
  height: 100%;
  background-color: transparent !important;
}
</style>

